home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1993 July / InfoMagic USENET CD-ROM July 1993.ISO / sources / x / volume0 / awm / part03 < prev    next >
Encoding:
Internet Message Format  |  1988-08-09  |  53.0 KB

  1. Path: uunet!wyse!mikew
  2. From: mikew@wyse.wyse.com (Mike Wexler)
  3. Newsgroups: comp.sources.x
  4. Subject: v00i004:  Ardent Window Manager(X11), Part03/13
  5. Message-ID: <1627@wyse.wyse.com>
  6. Date: 9 Aug 88 17:15:51 GMT
  7. Sender: news@wyse.wyse.com
  8. Lines: 1672
  9. Approved: mikew@wyse.com
  10.  
  11. Submitted-by: jkh@ardent (Jordan Hubbard)
  12. Posting-number: Volume 0, Issue 4
  13. Archive-name: awm/part03
  14.  
  15. #! /bin/sh
  16. # This is a shell archive.  Remove anything before this line, then unpack
  17. # it by saving it into a file and typing "sh file".  To overwrite existing
  18. # files, type "sh file -c".  You can also feed this as standard input via
  19. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  20. # will see the following message at the end:
  21. #        "End of archive 3 (of 13)."
  22. # Contents:  awm/Bindings.c awm/Cursors.c awm/Menu.c awm/Raise.c
  23. #   awm/Refresh.c awm/Restart.c awm/StoreBox.c awm/StoreZap.c
  24. #   awm/XRdBitFD.c awm/bitmaps/xterm.bm awm/menus/dbug.h
  25. # Wrapped by mikew@wyse on Mon Aug  8 12:01:42 1988
  26. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  27. if test -f awm/Bindings.c -a "${1}" != "-c" ; then 
  28.   echo shar: Will not over-write existing file \"awm/Bindings.c\"
  29. else
  30. echo shar: Extracting \"awm/Bindings.c\" \(3702 characters\)
  31. sed "s/^X//" >awm/Bindings.c <<'END_OF_awm/Bindings.c'
  32. X#ident   "%W% %G%"
  33. X
  34. X
  35. X
  36. X#ifndef lint
  37. Xstatic char *rcsid_Bindings_c = "$Header: Bindings.c,v 1.1 88/06/15 15:30:22 jkh Exp $";
  38. X#endif    lint
  39. X
  40. X#include "X11/copyright.h"
  41. X/*
  42. X *
  43. X * Copyright 1987, 1988 by Ardent Computer Corporation, Sunnyvale, Ca.
  44. X *
  45. X * Copyright 1987 by Jordan Hubbard.
  46. X *
  47. X *
  48. X *                         All Rights Reserved
  49. X *
  50. X * Permission to use, copy, modify, and distribute this software and its
  51. X * documentation for any purpose and without fee is hereby granted,
  52. X * provided that the above copyright notice appear in all copies and that
  53. X * both that copyright notice and this permission notice appear in
  54. X * supporting documentation, and that the name of Ardent Computer
  55. X * Corporation or Jordan Hubbard not be used in advertising or publicity
  56. X * pertaining to distribution of the software without specific, written
  57. X * prior permission.
  58. X *
  59. X */
  60. X
  61. X/*
  62. X * Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
  63. X *
  64. X *                         All Rights Reserved
  65. X *
  66. X * Permission to use, copy, modify, and distribute this software and its
  67. X * documentation for any purpose and without fee is hereby granted,
  68. X * provided that the above copyright notice appear in all copies and that
  69. X * both that copyright notice and this permission notice appear in
  70. X * supporting documentation, and that the name of Digital Equipment
  71. X * Corporation not be used in advertising or publicity pertaining to
  72. X * distribution of the software without specific, written prior permission.
  73. X *
  74. X *
  75. X * DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
  76. X * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
  77. X * DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
  78. X * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
  79. X * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
  80. X * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
  81. X * SOFTWARE.
  82. X */
  83. X
  84. X
  85. X
  86. X/*
  87. X * MODIFICATION HISTORY
  88. X *
  89. X * 000 -- M. Gancarz, DEC Ultrix Engineering Group
  90. X */
  91. X
  92. X#ifndef lint
  93. Xstatic char *sccsid = "@(#)Bindings.c    3.8    1/24/86";
  94. X#endif
  95. X
  96. X/*
  97. X * Bindings.c     Default bindings for the X window manager 'awm'
  98. X *
  99. X * Note: Any changes to this file should also be added to the file
  100. X * /usr/new/lib/X/awm/default.awmrc to keep users informed as to the bindings
  101. X * contained herein.
  102. X */
  103. X
  104. Xchar *DefaultBindings[] = {
  105. X"menu=\"WindowOps\"{",
  106. X"New Window:!\"xterm&\"",
  107. X"RefreshScreen:f.refresh",
  108. X"Redraw:f.redraw",
  109. X"Move:f.move",
  110. X"Resize:f.resize",
  111. X"Lower:f.lower",
  112. X"Raise:f.raise",
  113. X"CircUp:f.circleup",
  114. X"CircDown:f.circledown",
  115. X"AutoIconify:f.iconify",
  116. X"LowerIconify:f.newiconify",
  117. X"NewIconify:f.newiconify",
  118. X"Focus:f.focus",
  119. X"Freeze:f.pause",
  120. X"UnFreeze:f.continue",
  121. X"Restart:f.restart",
  122. X"}",
  123. X"menu=\"Preferences\"{",
  124. X"Bell Loud:!\"xset b 7&\"",
  125. X"Bell Normal:!\"xset b 3&\"",
  126. X"Bell Off:!\"xset b off&\"",
  127. X"Click Loud:!\"xset c 8&\"",
  128. X"Click Soft:!\"xset c on&\"",
  129. X"Click Off:!\"xset c off&\"",
  130. X"Lock On:!\"xset l on&\"",
  131. X"Lock Off:!\"xset l off&\"",
  132. X"Mouse Fast:!\"xset m 4 2&\"",
  133. X"Mouse Normal:!\"xset m 2 5&\"",
  134. X"Mouse Slow:!\"xset m 1 1&\"",
  135. X"}",
  136. X"f.newiconify=m:w|i:delta l",
  137. X"f.raise=m:w|i:delta l",
  138. X"f.lower=m:w|i:l u",
  139. X"f.raise=m:w:m d",
  140. X"f.resize=m:w:delta m",
  141. X"f.iconify=m:i:m u",
  142. X"f.raise=m:w|i:r d",
  143. X"f.move=m:w|i:delta r",
  144. X"f.circledown=m:r:l d",
  145. X"f.circleup=m:r:r d",
  146. X"f.circledown=m|s::l d",
  147. X"f.menu=:r:m d:\"WindowOps\"",
  148. X"f.menu=m|s::m d:\"WindowOps\"",
  149. X"f.menu=m|s::m d:\"Preferences\"",
  150. X"f.circleup=m|s::r d",
  151. X"f.iconify=m|c:w|i:l d",
  152. X"f.newiconify=m|l:w|i:l d",
  153. X"f.raise=m|l:w|i:l u",
  154. X"f.pushright=m|l:w|i:r d",
  155. X"f.pushleft=m|c:w|i:r d",
  156. X"f.pushup=m|l:w|i:m d",
  157. X"f.pushdown=m|c:w|i:m d",
  158. X0    /* Must NOT be removed. */
  159. X};
  160. END_OF_awm/Bindings.c
  161. if test 3702 -ne `wc -c <awm/Bindings.c`; then
  162.     echo shar: \"awm/Bindings.c\" unpacked with wrong size!
  163. fi
  164. # end of overwriting check
  165. fi
  166. if test -f awm/Cursors.c -a "${1}" != "-c" ; then 
  167.   echo shar: Will not over-write existing file \"awm/Cursors.c\"
  168. else
  169. echo shar: Extracting \"awm/Cursors.c\" \(3888 characters\)
  170. sed "s/^X//" >awm/Cursors.c <<'END_OF_awm/Cursors.c'
  171. X#ident   "%W% %G%"
  172. X
  173. X
  174. X
  175. X#ifndef lint
  176. Xstatic char *rcsid_StoreCursors_c = "$Header: Cursors.c,v 1.1 88/06/15 15:21:52 jkh Exp $";
  177. X#endif    lint
  178. X
  179. X#include "X11/copyright.h"
  180. X/*
  181. X *
  182. X * Copyright 1987, 1988 by Ardent Computer Corporation, Sunnyvale, Ca.
  183. X *
  184. X * Copyright 1987 by Jordan Hubbard.
  185. X *
  186. X *
  187. X *                         All Rights Reserved
  188. X *
  189. X * Permission to use, copy, modify, and distribute this software and its
  190. X * documentation for any purpose and without fee is hereby granted,
  191. X * provided that the above copyright notice appear in all copies and that
  192. X * both that copyright notice and this permission notice appear in
  193. X * supporting documentation, and that the name of Ardent Computer
  194. X * Corporation or Jordan Hubbard not be used in advertising or publicity
  195. X * pertaining to distribution of the software without specific, written
  196. X * prior permission.
  197. X *
  198. X */
  199. X
  200. X/*
  201. X * Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
  202. X *
  203. X *                         All Rights Reserved
  204. X *
  205. X * Permission to use, copy, modify, and distribute this software and its
  206. X * documentation for any purpose and without fee is hereby granted,
  207. X * provided that the above copyright notice appear in all copies and that
  208. X * both that copyright notice and this permission notice appear in
  209. X * supporting documentation, and that the name of Digital Equipment
  210. X * Corporation not be used in advertising or publicity pertaining to
  211. X * distribution of the software without specific, written prior permission.
  212. X *
  213. X *
  214. X * DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
  215. X * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
  216. X * DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
  217. X * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
  218. X * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
  219. X * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
  220. X * SOFTWARE.
  221. X */
  222. X
  223. X
  224. X
  225. X/*
  226. X * MODIFICATION HISTORY
  227. X *
  228. X * 000 -- M. Gancarz, DEC Ultrix Engineering Group
  229. X * 001 -- Loretta Guarino Reid, DEC Ultrix Engineering Group
  230. X *        Convert to X11
  231. X */
  232. X
  233. X#ifndef lint
  234. Xstatic char *sccsid = "@(#)StoreCursors.c    3.8    1/24/86";
  235. X#endif
  236. X
  237. X#include "awm.h"
  238. X#include "X11/cursorfont.h"
  239. X
  240. X/*
  241. X * Store all the cursors into global variables.
  242. X */
  243. XStoreCursors()
  244. X{
  245. X    Entry("StoreCursors")
  246. X
  247. X    /*
  248. X     * Main awm cursor and movement cursor.
  249. X     */
  250. X    ArrowCrossCursor = XCreateFontCursor(dpy, XC_fleur);
  251. X    if (ArrowCrossCursor == FAILURE) {
  252. X    Error("StoreCursors -> Unable to store ArrowCrossCursor.");
  253. X    }
  254. X
  255. X    /*
  256. X     * Text cursor used in icons.
  257. X     */
  258. X    TextCursor = XCreateFontCursor(dpy, XC_xterm);    
  259. X    if (TextCursor == FAILURE) {
  260. X    Error("StoreCursors -> Unable to store TextCursor.");
  261. X    }
  262. X
  263. X    /*
  264. X     * Icon cursor used to iconify windows.
  265. X     */
  266. X    IconCursor = XCreateFontCursor(dpy, XC_icon);    
  267. X    if (IconCursor == FAILURE) {
  268. X    Error("StoreCursors -> Unable to store IconCursor.");
  269. X    }
  270. X
  271. X    /*
  272. X     * Left button main cursor.
  273. X     */
  274. X    LeftButtonCursor = XCreateFontCursor(dpy, XC_leftbutton);    
  275. X    if (LeftButtonCursor == FAILURE) {
  276. X    Error("StoreCursors -> Unable to store LeftButtonCursor.");
  277. X    }
  278. X
  279. X    /*
  280. X     * Middle button main cursor.
  281. X     */
  282. X    MiddleButtonCursor = XCreateFontCursor(dpy, XC_middlebutton);    
  283. X    if (MiddleButtonCursor == FAILURE) {
  284. X    Error("StoreCursors -> Unable to store MiddleButtonCursor.");
  285. X    }
  286. X
  287. X    /*
  288. X     * Right button main cursor.
  289. X     */
  290. X    RightButtonCursor = XCreateFontCursor(dpy, XC_rightbutton);    
  291. X    if (RightButtonCursor == FAILURE) {
  292. X    Error("StoreCursors -> Unable to store RightButtonCursor.");
  293. X    }
  294. X
  295. X    /*
  296. X     * Targer cursor used to identify a window for an action.
  297. X     */
  298. X    TargetCursor = XCreateFontCursor(dpy, XC_circle);    
  299. X    if (TargetCursor == FAILURE) {
  300. X    Error("StoreCursors -> Unable to store TargetCursor.");
  301. X    }
  302. X    Leave(0)
  303. X}
  304. X
  305. END_OF_awm/Cursors.c
  306. if test 3888 -ne `wc -c <awm/Cursors.c`; then
  307.     echo shar: \"awm/Cursors.c\" unpacked with wrong size!
  308. fi
  309. # end of overwriting check
  310. fi
  311. if test -f awm/Menu.c -a "${1}" != "-c" ; then 
  312.   echo shar: Will not over-write existing file \"awm/Menu.c\"
  313. else
  314. echo shar: Extracting \"awm/Menu.c\" \(4280 characters\)
  315. sed "s/^X//" >awm/Menu.c <<'END_OF_awm/Menu.c'
  316. X#ident   "%W% %G%"
  317. X
  318. X
  319. X
  320. X#ifndef lint
  321. Xstatic char *rcsid_Menu_c = "$Header: Menu.c,v 1.1 88/06/15 15:08:09 jkh Exp $";
  322. X#endif    lint
  323. X
  324. X#include "X11/copyright.h"
  325. X/*
  326. X *
  327. X * Copyright 1987, 1988 by Ardent Computer Corporation, Sunnyvale, Ca.
  328. X *
  329. X * Copyright 1987 by Jordan Hubbard.
  330. X *
  331. X *
  332. X *                         All Rights Reserved
  333. X *
  334. X * Permission to use, copy, modify, and distribute this software and its
  335. X * documentation for any purpose and without fee is hereby granted,
  336. X * provided that the above copyright notice appear in all copies and that
  337. X * both that copyright notice and this permission notice appear in
  338. X * supporting documentation, and that the name of Ardent Computer
  339. X * Corporation or Jordan Hubbard not be used in advertising or publicity
  340. X * pertaining to distribution of the software without specific, written
  341. X * prior permission.
  342. X *
  343. X */
  344. X
  345. X#include <signal.h>
  346. X#include "X11/cursorfont.h"
  347. X
  348. X/*
  349. X * MODIFICATION HISTORY
  350. X *
  351. X * 000 -- J.Hubbard, Ardent Computer.
  352. X *     This file bears little resemblance to its former namesake.
  353. X *    Because of massive changes to support RTL menus, the Menu()
  354. X *      function is now little more than a bootstrap for RTL.
  355. X */
  356. X
  357. X#ifndef lint
  358. Xstatic char *sccsid = "@(#)Menu.c    3.8    1/24/86";
  359. X#endif
  360. X
  361. X#include "awm.h"
  362. X
  363. XBoolean DoMenu(window, mask, button, x, y, menu)
  364. XWindow window;                /* Event window. */
  365. Xint mask;                /* Button/key mask. */
  366. Xint button;                /* Button event detail. */
  367. Xint x, y;                /* Event mouse position. */
  368. XRTLMenu menu;
  369. X{
  370. X     RTLPoint pos;
  371. X     
  372. X     Entry("DoMenu")
  373. X      
  374. X     pos.x = x;
  375. X     pos.y = y;
  376. X     if (!menu)
  377. X    Leave(FALSE)
  378. X     RTLMenu_Enter(menu, button, 0, window, pos);
  379. X     Leave(TRUE)
  380. X}
  381. X
  382. XBoolean DoAction(window, mask, button, x, y, menu, action)
  383. XWindow window;                /* Event window. */
  384. Xint mask;                /* Button/key mask. */
  385. Xint button;                /* Button event detail. */
  386. Xint x, y;                /* Event mouse position. */
  387. XRTLMenu menu;
  388. XActionLine *action;
  389. X{
  390. X     Boolean *tmp;
  391. X     char *buff, *cmd;
  392. X     int status, pid, w;
  393. X     register int (*istat)(), (*qstat)();
  394. X
  395. X     Entry("DoAction")
  396. X
  397. X     switch(action->type) {
  398. X     case IsText:
  399. X      XStoreBytes(dpy, action->text, strlen(action->text));
  400. X      break;
  401. X
  402. X     case IsTextNL:
  403. X      buff = (char *)malloc(strlen(action->text) + 2);
  404. X      strcpy(buff, action->text);
  405. X      strcat(buff, "\n");
  406. X      XStoreBytes(dpy, buff, strlen(buff));
  407. X      free(buff);
  408. X      break;
  409. X
  410. X     case IsShellCommand:
  411. X      cmd = action->text;
  412. X      if ((pid = fork()) == 0) {
  413. X           setpgrp(0, 0);
  414. X           signal(SIGHUP, SIG_IGN);
  415. X           signal(SIGQUIT, SIG_IGN);
  416. X           signal(SIGINT, SIG_IGN);
  417. X           execl("/bin/sh", "sh", "-c", cmd, 0);
  418. X           _exit(127);
  419. X      }
  420. X      istat = signal(SIGINT, SIG_IGN);
  421. X      qstat = signal(SIGQUIT, SIG_IGN);
  422. X      while ((w = wait(&status)) != pid && w != -1);
  423. X      if (w == -1)
  424. X           status = -1;
  425. X      signal(SIGINT, istat);
  426. X      signal(SIGQUIT, qstat);
  427. X      break;
  428. X
  429. X     default:
  430. X      fprintf(stderr, "awm: Warning: Unknown action type %d (%s) invoked\n",
  431. X          action->type, action->text);
  432. X      break;
  433. X     }
  434. X}
  435. X
  436. X/*
  437. X * Routine to let user select a window using the mouse
  438. X */
  439. X
  440. XWindow Select_Window(x, y, button)
  441. Xint *x, *y, *button;
  442. X{
  443. X     int status;
  444. X     Cursor cursor;
  445. X     XEvent event;
  446. X     Window target_win, root;
  447. X     int root_x, root_y, x2, y2, ptrmask;
  448. X     AwmInfoPtr awi;
  449. X     
  450. X     Entry("Select_Window")
  451. X      
  452. X     /* Make the target cursor */
  453. X     if (XGrabPointer( dpy, RootWindow(dpy, scr),
  454. X              TRUE, EVENTMASK, GrabModeAsync,
  455. X              GrabModeAsync, None,
  456. X              TargetCursor, CurrentTime )
  457. X     != GrabSuccess ) {
  458. X      fprintf(stderr, "awm (Select_Window): Can't grab the mouse.");
  459. X      Leave(RootWindow(dpy, scr))
  460. X     }
  461. X     Snatched = TRUE;
  462. X     /* Select a window */
  463. X     while (TRUE) {
  464. X      XPeekEvent(dpy, &event);
  465. X      if (event.type != ButtonPress) {
  466. X           GetButton(&event);
  467. X           continue;
  468. X      }
  469. X          XNextEvent(dpy, &event);
  470. X      XQueryPointer(dpy, RootWindow(dpy, scr), &root,
  471. X            &target_win, &root_x, &root_y, &x2, &y2, &ptrmask);
  472. X
  473. X      *x = root_x;
  474. X      *y = root_y;
  475. X      *button = event.xbutton.button;
  476. X      if (target_win == 0)
  477. X           target_win = event.xbutton.window;
  478. X      XUngrabPointer(dpy, CurrentTime);      /* Done with pointer */
  479. X      if (awi = GetAwmInfo(target_win))
  480. X           target_win = (awi->frame) ? awi->frame : awi->client;
  481. X      Snatched = FALSE;
  482. X      Leave(target_win)
  483. X     }
  484. X}
  485. END_OF_awm/Menu.c
  486. if test 4280 -ne `wc -c <awm/Menu.c`; then
  487.     echo shar: \"awm/Menu.c\" unpacked with wrong size!
  488. fi
  489. # end of overwriting check
  490. fi
  491. if test -f awm/Raise.c -a "${1}" != "-c" ; then 
  492.   echo shar: Will not over-write existing file \"awm/Raise.c\"
  493. else
  494. echo shar: Extracting \"awm/Raise.c\" \(3678 characters\)
  495. sed "s/^X//" >awm/Raise.c <<'END_OF_awm/Raise.c'
  496. X#ident   "%W% %G%"
  497. X
  498. X
  499. X
  500. X#ifndef lint
  501. Xstatic char *rcsid_Raise_c = "$Header: Raise.c,v 1.1 88/06/15 15:24:56 jkh Exp $";
  502. X#endif  lint
  503. X
  504. X#include "X11/copyright.h"
  505. X/*
  506. X *
  507. X * Copyright 1987, 1988 by Ardent Computer Corporation, Sunnyvale, Ca.
  508. X *
  509. X * Copyright 1987 by Jordan Hubbard.
  510. X *
  511. X *
  512. X *                         All Rights Reserved
  513. X *
  514. X * Permission to use, copy, modify, and distribute this software and its
  515. X * documentation for any purpose and without fee is hereby granted,
  516. X * provided that the above copyright notice appear in all copies and that
  517. X * both that copyright notice and this permission notice appear in
  518. X * supporting documentation, and that the name of Ardent Computer
  519. X * Corporation or Jordan Hubbard not be used in advertising or publicity
  520. X * pertaining to distribution of the software without specific, written
  521. X * prior permission.
  522. X *
  523. X */
  524. X
  525. X/*
  526. X * Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
  527. X *
  528. X *                         All Rights Reserved
  529. X *
  530. X * Permission to use, copy, modify, and distribute this software and its
  531. X * documentation for any purpose and without fee is hereby granted,
  532. X * provided that the above copyright notice appear in all copies and that
  533. X * both that copyright notice and this permission notice appear in
  534. X * supporting documentation, and that the name of Digital Equipment
  535. X * Corporation not be used in advertising or publicity pertaining to
  536. X * distribution of the software without specific, written prior permission.
  537. X *
  538. X *
  539. X * DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
  540. X * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
  541. X * DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
  542. X * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
  543. X * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
  544. X * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
  545. X * SOFTWARE.
  546. X */
  547. X
  548. X
  549. X/*
  550. X * MODIFICATION HISTORY
  551. X *
  552. X * 000 -- M. Gancarz, DEC Ultrix Engineering Group
  553. X * 001 -- R. Kittell, DEC Storage A/D May 19, 1986
  554. X *  Optionally warp mouse to upper right corner of window after raise.
  555. X * 002 -- Loretta Guarino Reid, DEC Ultrix Engineering Group
  556. X *  Western Software Lab. Convert to X11.
  557. X * 003 -- Jordan Hubbard, Ardent Computer
  558. X *  Changed for awm.
  559. X */
  560. X
  561. X#include "awm.h"
  562. X
  563. XBoolean Raise(window, mask, button, x, y)
  564. XWindow window;                          /* Event window. */
  565. Xint mask;                               /* Button/key mask. */
  566. Xint button;                               /* Button event detail. */
  567. Xint x, y;                               /* Event mouse position. */
  568. X
  569. X{
  570. X     XWindowAttributes winfo;            /* Window details for warp */
  571. X     AwmInfoPtr awi;
  572. X     int status, vpoint;
  573. X     
  574. X     Entry("Raise")
  575. X     
  576. X     /*
  577. X      * If the window is not the root window, raise the window and return.
  578. X      */
  579. X
  580. X     awi = GetAwmInfo(window);
  581. X     if (!awi)
  582. X      Leave(FALSE)
  583. X     if (window != RootWindow(dpy, scr)) {
  584. X      window = awi->frame ? awi->frame : awi->client;
  585. X      XRaiseWindow(dpy, window);
  586. X      if (awi->frame)
  587. X           vpoint = 10 + titleHeight + 2;
  588. X      else
  589. X           vpoint = 10;
  590. X      /*
  591. X       * Optionally warp the mouse to the upper left corner of the window.
  592. X       */
  593. X      if (WarpOnRaise) {
  594. X           status = XGetWindowAttributes (dpy, window, &winfo);
  595. X           if (status == FAILURE)
  596. X            Leave(FALSE)
  597. X           
  598. X           status = XWarpPointer (dpy, None, window, 
  599. X                      0, 0, 0, 0,
  600. X                      winfo.width >= 7 ? winfo.width - 7 :
  601. X                      winfo.width / 2,
  602. X                      winfo.height >= vpoint ? vpoint :
  603. X                      winfo.height / 2);
  604. X           if (status == FAILURE)
  605. X            Leave(FALSE)
  606. X      }
  607. X     }
  608. X     Leave(FALSE)
  609. X}
  610. END_OF_awm/Raise.c
  611. if test 3678 -ne `wc -c <awm/Raise.c`; then
  612.     echo shar: \"awm/Raise.c\" unpacked with wrong size!
  613. fi
  614. # end of overwriting check
  615. fi
  616. if test -f awm/Refresh.c -a "${1}" != "-c" ; then 
  617.   echo shar: Will not over-write existing file \"awm/Refresh.c\"
  618. else
  619. echo shar: Extracting \"awm/Refresh.c\" \(4348 characters\)
  620. sed "s/^X//" >awm/Refresh.c <<'END_OF_awm/Refresh.c'
  621. X#ident   "%W% %G%"
  622. X
  623. X
  624. X
  625. X#ifndef lint
  626. Xstatic char *rcsid_Refresh_c = "$Header: Refresh.c,v 1.1 88/06/15 15:29:10 jkh Exp $";
  627. X#endif    lint
  628. X
  629. X#include "X11/copyright.h"
  630. X/*
  631. X *
  632. X * Copyright 1987, 1988 by Ardent Computer Corporation, Sunnyvale, Ca.
  633. X *
  634. X * Copyright 1987 by Jordan Hubbard.
  635. X *
  636. X *
  637. X *                         All Rights Reserved
  638. X *
  639. X * Permission to use, copy, modify, and distribute this software and its
  640. X * documentation for any purpose and without fee is hereby granted,
  641. X * provided that the above copyright notice appear in all copies and that
  642. X * both that copyright notice and this permission notice appear in
  643. X * supporting documentation, and that the name of Ardent Computer
  644. X * Corporation or Jordan Hubbard not be used in advertising or publicity
  645. X * pertaining to distribution of the software without specific, written
  646. X * prior permission.
  647. X *
  648. X */
  649. X
  650. X/*
  651. X * Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
  652. X *
  653. X *                         All Rights Reserved
  654. X *
  655. X * Permission to use, copy, modify, and distribute this software and its
  656. X * documentation for any purpose and without fee is hereby granted,
  657. X * provided that the above copyright notice appear in all copies and that
  658. X * both that copyright notice and this permission notice appear in
  659. X * supporting documentation, and that the name of Digital Equipment
  660. X * Corporation not be used in advertising or publicity pertaining to
  661. X * distribution of the software without specific, written prior permission.
  662. X *
  663. X *
  664. X * DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
  665. X * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
  666. X * DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
  667. X * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
  668. X * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
  669. X * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
  670. X * SOFTWARE.
  671. X */
  672. X
  673. X
  674. X/*
  675. X * MODIFICATION HISTORY
  676. X *
  677. X * 000 -- M. Gancarz, DEC Ultrix Engineering Group
  678. X * 001 -- Loretta Guarino Reid, DEC Ultrix Engineering Group,
  679. X *  Western Software Lab. Convert to X11.
  680. X * 002 -- Jordan Hubbard, Ardent Computer
  681. X *  Changes for awm.
  682. X */
  683. X
  684. X#include "awm.h"
  685. X
  686. XBoolean Refresh(window, mask, button, x, y)
  687. XWindow window;                          /* Event window. */
  688. Xint mask;                               /* Button/key mask. */
  689. Xint button;                           /* Button event detail. */
  690. Xint x, y;                               /* Event mouse position. */
  691. X{
  692. X    Entry("Refresh")
  693. X
  694. X#ifdef titan
  695. X    XTitanReset(dpy);
  696. X#endif /* titan */
  697. X    Leave( Redraw(RootWindow(dpy,scr), mask, button, x, y) )
  698. X}
  699. X
  700. X
  701. X
  702. XBoolean Redraw(window, mask, button, x, y)
  703. XWindow window;                          /* Event window. */
  704. Xint mask;                               /* Button/key mask. */
  705. Xint button;                             /* Button event detail. */
  706. Xint x, y;                               /* Event mouse position. */
  707. X{
  708. X    XWindowAttributes winfo;        /* window info. */
  709. X    XSetWindowAttributes swa;        /* New window info */
  710. X    Window w;                /* Refresh window. */
  711. X
  712. X    Entry("Redraw")
  713. X
  714. X    /*
  715. X     * Get info on the target window.
  716. X     */
  717. X    status = XGetWindowAttributes(dpy, window, &winfo);
  718. X    if (status == FAILURE)
  719. X     Error("Refresh -> Can't query target window.");
  720. X    /*
  721. X     * Create and map a window which covers the target window, then destroy it.
  722. X     */
  723. X    swa.override_redirect = TRUE;
  724. X    swa.background_pixel = 0;
  725. X
  726. X    /*
  727. X     * What we have here is a failure to communicate. This window should
  728. X     * more properly be created as a subwindow of "window", but
  729. X     * when we do that, all events (Create, Map, Destroy) get reported
  730. X     * as coming from "window", not the newly created one. This is
  731. X     * very nasty when the DestroyNotify is received. For now, we'll
  732. X     * create it on the RootWindow and take the chance of generating an
  733. X     * expose on an overlapping window.
  734. X     */
  735. X    if ((w = XCreateWindow(dpy, RootWindow(dpy, scr), winfo.x, winfo.y, 
  736. X               winfo.width, winfo.height, 0,
  737. X               DefaultDepth(dpy, scr),
  738. X               CopyFromParent,
  739. X               DefaultVisual(dpy, scr),
  740. X               (CWOverrideRedirect | CWBackPixel),
  741. X               &swa)) == NULL)
  742. X     Error("Refresh -> Can't create refresh window.");
  743. X    XMapWindow(dpy, w);
  744. X    XDestroyWindow(dpy, w);
  745. X    XFlush(dpy);
  746. X    Leave(FALSE)
  747. X}
  748. END_OF_awm/Refresh.c
  749. if test 4348 -ne `wc -c <awm/Refresh.c`; then
  750.     echo shar: \"awm/Refresh.c\" unpacked with wrong size!
  751. fi
  752. # end of overwriting check
  753. fi
  754. if test -f awm/Restart.c -a "${1}" != "-c" ; then 
  755.   echo shar: Will not over-write existing file \"awm/Restart.c\"
  756. else
  757. echo shar: Extracting \"awm/Restart.c\" \(5018 characters\)
  758. sed "s/^X//" >awm/Restart.c <<'END_OF_awm/Restart.c'
  759. X#ident   "%W% %G%"
  760. X
  761. X
  762. X
  763. X#ifndef lint
  764. Xstatic char *rcsid_Restart_c = "$Header: Restart.c,v 1.2 88/07/23 17:24:56 jkh Exp $";
  765. X#endif  lint
  766. X
  767. X#include "X11/copyright.h"
  768. X/*
  769. X *
  770. X * Copyright 1987, 1988 by Ardent Computer Corporation, Sunnyvale, Ca.
  771. X *
  772. X * Copyright 1987 by Jordan Hubbard.
  773. X *
  774. X *
  775. X *                         All Rights Reserved
  776. X *
  777. X * Permission to use, copy, modify, and distribute this software and its
  778. X * documentation for any purpose and without fee is hereby granted,
  779. X * provided that the above copyright notice appear in all copies and that
  780. X * both that copyright notice and this permission notice appear in
  781. X * supporting documentation, and that the name of Ardent Computer
  782. X * Corporation or Jordan Hubbard not be used in advertising or publicity
  783. X * pertaining to distribution of the software without specific, written
  784. X * prior permission.
  785. X *
  786. X */
  787. X
  788. X/*
  789. X * Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
  790. X *
  791. X *                         All Rights Reserved
  792. X *
  793. X * Permission to use, copy, modify, and distribute this software and its
  794. X * documentation for any purpose and without fee is hereby granted,
  795. X * provided that the above copyright notice appear in all copies and that
  796. X * both that copyright notice and this permission notice appear in
  797. X * supporting documentation, and that the name of Digital Equipment
  798. X * Corporation not be used in advertising or publicity pertaining to
  799. X * distribution of the software without specific, written prior permission.
  800. X *
  801. X *
  802. X * DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
  803. X * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
  804. X * DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
  805. X * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
  806. X * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
  807. X * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
  808. X * SOFTWARE.
  809. X */
  810. X
  811. X/*
  812. X * MODIFICATION HISTORY
  813. X *
  814. X * 000 -- M. Gancarz, DEC Ultrix Engineering Group
  815. X * 001 -- Loretta Guarino Reid, DEC Ultrix Engineering Group,
  816. X    Western Software Lab. Convert to X11.
  817. X * 002 -- Jordan Hubbard, U.C. Berkeley. Titlebar cleanup code.
  818. X */
  819. X
  820. X#include "awm.h"
  821. X#include "X11/Xutil.h"
  822. X
  823. Xextern XContext AwmContext;
  824. X
  825. XBoolean Restart(window, mask, button, x, y)
  826. XWindow window;                          /* Event window. */
  827. Xint mask;                               /* Button/key mask. */
  828. Xint button;                             /* Button event detail. */
  829. Xint x, y;                               /* Event mouse position. */
  830. X{
  831. X    XButtonEvent button_event;
  832. X
  833. X    Entry("Restart")
  834. X
  835. X    XFreeFont(dpy, IFontInfo);
  836. X    XFreeFont(dpy, PFontInfo);
  837. X    XBell(dpy, VOLUME_PERCENTAGE(Volume));
  838. X    XBell(dpy, VOLUME_PERCENTAGE(Volume));
  839. X    XFlush(dpy);
  840. X    Cleanup();
  841. X    execvp(*Argv, Argv, Environ);
  842. X    fprintf(stderr, "awm: Restart failed!\n");
  843. X    exit(1);
  844. X}
  845. X
  846. XBoolean Quit(window, mask, button, x, y)
  847. XWindow window;                          /* Event window. */
  848. Xint mask;                               /* Button/key mask. */
  849. Xint button;                             /* Button event detail. */
  850. Xint x, y;                               /* Event mouse position. */
  851. X{
  852. X     Entry("Quit")
  853. X
  854. X     Cleanup();
  855. X     exit(0);
  856. X}
  857. X
  858. XBoolean DestroyClient(window, mask, button, x, y)
  859. XWindow window;
  860. Xint mask;
  861. Xint x, y;
  862. X{
  863. X     AwmInfoPtr awi;
  864. X
  865. X     Entry("DestroyClient")
  866. X
  867. X     if (window == RootWindow(dpy, scr))
  868. X        Leave(FALSE)
  869. X     awi = GetAwmInfo(window);
  870. X     /*
  871. X      * If it's a titled window or an icon (we don't want to nuke ourselves)
  872. X      * we should get the client for it. We assume the subsequent destroy
  873. X      * notify will tell us to reclaim our resources.
  874. X      */
  875. X     window = awi->client;
  876. X     XKillClient(dpy, window);
  877. X     Leave(TRUE)
  878. X}
  879. X
  880. X/*
  881. X * Put any necessary cleanup code here, it will be invoked when awm exits
  882. X * or restarts. Currently just checks for title bar resources.
  883. X */
  884. XCleanup()
  885. X{
  886. X     Window junk, *windows;
  887. X     int nwins;
  888. X     AwmInfoPtr awi;
  889. X
  890. X     Entry("Cleanup");
  891. X
  892. X     if (XQueryTree(dpy, DefaultRootWindow(dpy), &junk, &junk, &windows, &nwins)
  893. X     != BadWindow) {
  894. X      unsigned int i;
  895. X      
  896. X      for (i = 0; i < nwins; i++) {
  897. X           XWindowAttributes xwa;
  898. X           int bw;
  899. X
  900. X           awi = GetAwmInfo(windows[i]);
  901. X           if (!awi)
  902. X            continue;
  903. X           bw = awi->border_width;
  904. X           if (awi->state & ST_ICON)
  905. X            XMapWindow(dpy, awi->client);
  906. X           RemoveIcon(windows[i]);
  907. X           XGetWindowAttributes(dpy, awi->frame, &xwa);
  908. X           if (PushDown == FALSE) {
  909. X            if (awi->attrs & AT_TITLE)
  910. X             xwa.y += (titleHeight + 2);
  911. X            else if (awi->attrs & AT_BORDER)
  912. X             xwa.y += BContext;
  913. X           }
  914. X           if (awi->attrs & AT_BORDER)
  915. X            xwa.x -= (BContext + (bw ? bw : 1));
  916. X           XReparentWindow(dpy, awi->client, RootWindow(dpy, scr),
  917. X                   xwa.x, xwa.y);
  918. X           XRemoveFromSaveSet(dpy, awi->client);
  919. X           XSetWindowBorderWidth(dpy, awi->client, awi->border_width);
  920. X           free(awi);
  921. X      }
  922. X      XFree(windows);
  923. X     }
  924. X     Leave_void
  925. X}
  926. END_OF_awm/Restart.c
  927. if test 5018 -ne `wc -c <awm/Restart.c`; then
  928.     echo shar: \"awm/Restart.c\" unpacked with wrong size!
  929. fi
  930. # end of overwriting check
  931. fi
  932. if test -f awm/StoreBox.c -a "${1}" != "-c" ; then 
  933.   echo shar: Will not over-write existing file \"awm/StoreBox.c\"
  934. else
  935. echo shar: Extracting \"awm/StoreBox.c\" \(5215 characters\)
  936. sed "s/^X//" >awm/StoreBox.c <<'END_OF_awm/StoreBox.c'
  937. X#ident   "%W% %G%"
  938. X
  939. X
  940. X
  941. X#ifndef lint
  942. Xstatic char *rcsid_StoreBox_c = "$Header: StoreBox.c,v 1.1 88/06/15 15:21:43 jkh Exp $";
  943. X#endif    lint
  944. X
  945. X#include "X11/copyright.h"
  946. X/*
  947. X *
  948. X * Copyright 1987, 1988 by Ardent Computer Corporation, Sunnyvale, Ca.
  949. X *
  950. X * Copyright 1987 by Jordan Hubbard.
  951. X *
  952. X *
  953. X *                         All Rights Reserved
  954. X *
  955. X * Permission to use, copy, modify, and distribute this software and its
  956. X * documentation for any purpose and without fee is hereby granted,
  957. X * provided that the above copyright notice appear in all copies and that
  958. X * both that copyright notice and this permission notice appear in
  959. X * supporting documentation, and that the name of Ardent Computer
  960. X * Corporation or Jordan Hubbard not be used in advertising or publicity
  961. X * pertaining to distribution of the software without specific, written
  962. X * prior permission.
  963. X *
  964. X */
  965. X
  966. X/*
  967. X * Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
  968. X *
  969. X *                         All Rights Reserved
  970. X *
  971. X * Permission to use, copy, modify, and distribute this software and its
  972. X * documentation for any purpose and without fee is hereby granted,
  973. X * provided that the above copyright notice appear in all copies and that
  974. X * both that copyright notice and this permission notice appear in
  975. X * supporting documentation, and that the name of Digital Equipment
  976. X * Corporation not be used in advertising or publicity pertaining to
  977. X * distribution of the software without specific, written prior permission.
  978. X *
  979. X *
  980. X * DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
  981. X * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
  982. X * DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
  983. X * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
  984. X * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
  985. X * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
  986. X * SOFTWARE.
  987. X */
  988. X
  989. X
  990. X
  991. X/*
  992. X * MODIFICATION HISTORY
  993. X *
  994. X * 000 -- M. Gancarz, DEC Ultrix Engineering Group
  995. X * 001 -- Loretta Guarino Reid, DEC Ultrix Engineering Group,
  996. X Western Software Lab. Convert to X11.
  997. X * 002 -- Jordan Hubbard, Ardent Computer
  998. X *  Additional boxes for titled windows.
  999. X */
  1000. X
  1001. X/*
  1002. X *    StoreBox - This subroutine is used by the X Window Manager (xwm)
  1003. X *    to store the vertices for the resize / movement box in a vertex list.
  1004. X */
  1005. X
  1006. X#include "awm.h"
  1007. X
  1008. X/*
  1009. X * Store the vertices for the resize movement box (on a titled window)
  1010. X * in a vertex list.
  1011. X */
  1012. Xint StoreTitleBox(box, ulx, uly, lrx, lry)
  1013. Xregister XSegment box[];
  1014. Xint ulx;            /* Upper left X coordinate. */
  1015. Xint uly;            /* Upper left Y coordinate. */
  1016. Xint lrx;            /* Lower right X coordinate. */
  1017. Xint lry;            /* Lower right Y coordinate. */
  1018. X{
  1019. X     Entry("StoreTitleBox");
  1020. X     
  1021. X     /*
  1022. X      * Xor in.
  1023. X      */
  1024. X     
  1025. X     box[0].x1 = ulx; box[0].y1 = uly;
  1026. X     box[0].x2 = lrx; box[0].y2 = uly;
  1027. X
  1028. X     box[1].x1 = ulx; box[1].y1 = uly + titleHeight + 2;
  1029. X     box[1].x2 = lrx; box[1].y2 = uly + titleHeight + 2;
  1030. X     
  1031. X     box[2].x1 = lrx; box[2].y1 = uly;
  1032. X     box[2].x2 = lrx; box[2].y2 = lry;
  1033. X     
  1034. X     box[3].x1 = lrx; box[3].y1 = lry;
  1035. X     box[3].x2 = ulx; box[3].y2 = lry;
  1036. X     
  1037. X     box[4].x1 = ulx; box[4].y1 = lry;
  1038. X     box[4].x2 = ulx; box[4].y2 = uly;
  1039. X
  1040. X     
  1041. X     /*
  1042. X      * If we freeze the screen, don't bother to xor out.
  1043. X      */
  1044. X     if (Freeze)
  1045. X      Leave(5)
  1046. X     
  1047. X     /*
  1048. X      * Xor out.
  1049. X      */
  1050. X     box[4].x1 = ulx; box[4].y1 = uly;
  1051. X     box[4].x2 = lrx; box[4].y2 = uly;
  1052. X     
  1053. X     box[5].x1 = ulx; box[5].y1 = uly + titleHeight + 2;
  1054. X     box[5].x2 = lrx; box[5].y2 = uly + titleHeight + 2;
  1055. X     
  1056. X     box[6].x1 = lrx; box[6].y1 = uly;
  1057. X     box[6].x2 = lrx; box[6].y2 = lry;
  1058. X     
  1059. X     box[7].x1 = lrx; box[7].y1 = lry;
  1060. X     box[7].x2 = ulx; box[7].y2 = lry;
  1061. X     
  1062. X     box[8].x1 = ulx; box[8].y1 = lry;
  1063. X     box[8].x2 = ulx; box[8].y2 = uly;
  1064. X     
  1065. X     
  1066. X     /*
  1067. X      * Total number of vertices is 9.
  1068. X      */
  1069. X     Leave(9)
  1070. X}
  1071. X
  1072. X/*
  1073. X * Store the vertices for the resize movement box in a vertex list.
  1074. X */
  1075. Xint StoreBox(box, ulx, uly, lrx, lry)
  1076. Xregister XSegment box[];
  1077. Xint ulx;            /* Upper left X coordinate. */
  1078. Xint uly;            /* Upper left Y coordinate. */
  1079. Xint lrx;            /* Lower right X coordinate. */
  1080. Xint lry;            /* Lower right Y coordinate. */
  1081. X{
  1082. X     Entry("StoreBox");
  1083. X     
  1084. X     /*
  1085. X      * Xor in.
  1086. X      */
  1087. X     
  1088. X     box[0].x1 = ulx; box[0].y1 = uly;
  1089. X     box[0].x2 = lrx; box[0].y2 = uly;
  1090. X     
  1091. X     box[1].x1 = lrx; box[1].y1 = uly;
  1092. X     box[1].x2 = lrx; box[1].y2 = lry;
  1093. X     
  1094. X     box[2].x1 = lrx; box[2].y1 = lry;
  1095. X     box[2].x2 = ulx; box[2].y2 = lry;
  1096. X     
  1097. X     box[3].x1 = ulx; box[3].y1 = lry;
  1098. X     box[3].x2 = ulx; box[3].y2 = uly;
  1099. X     
  1100. X     
  1101. X     /*
  1102. X      * If we freeze the screen, don't bother to xor out.
  1103. X      */
  1104. X     if (Freeze)
  1105. X      Leave(4)
  1106. X     
  1107. X     /*
  1108. X      * Xor out.
  1109. X      */
  1110. X     box[4].x1 = ulx; box[4].y1 = uly;
  1111. X     box[4].x2 = lrx; box[4].y2 = uly;
  1112. X     
  1113. X     box[5].x1 = lrx; box[5].y1 = uly;
  1114. X     box[5].x2 = lrx; box[5].y2 = lry;
  1115. X     
  1116. X     box[6].x1 = lrx; box[6].y1 = lry;
  1117. X     box[6].x2 = ulx; box[6].y2 = lry;
  1118. X     
  1119. X     box[7].x1 = ulx; box[7].y1 = lry;
  1120. X     box[7].x2 = ulx; box[7].y2 = uly;
  1121. X     
  1122. X     
  1123. X     /*
  1124. X      * Total number of vertices is 8.
  1125. X      */
  1126. X     Leave(8)
  1127. X}
  1128. END_OF_awm/StoreBox.c
  1129. if test 5215 -ne `wc -c <awm/StoreBox.c`; then
  1130.     echo shar: \"awm/StoreBox.c\" unpacked with wrong size!
  1131. fi
  1132. # end of overwriting check
  1133. fi
  1134. if test -f awm/StoreZap.c -a "${1}" != "-c" ; then 
  1135.   echo shar: Will not over-write existing file \"awm/StoreZap.c\"
  1136. else
  1137. echo shar: Extracting \"awm/StoreZap.c\" \(3762 characters\)
  1138. sed "s/^X//" >awm/StoreZap.c <<'END_OF_awm/StoreZap.c'
  1139. X#ident   "%W% %G%"
  1140. X
  1141. X
  1142. X
  1143. X#ifndef lint
  1144. Xstatic char *rcsid_StoreZap_c = "$Header: StoreZap.c,v 1.1 88/06/15 08:21:46 jkh Exp $";
  1145. X#endif    lint
  1146. X
  1147. X#include "X11/copyright.h"
  1148. X/*
  1149. X *
  1150. X * Copyright 1987, 1988 by Ardent Computer Corporation, Sunnyvale, Ca.
  1151. X *
  1152. X * Copyright 1987 by Jordan Hubbard.
  1153. X *
  1154. X *
  1155. X *                         All Rights Reserved
  1156. X *
  1157. X * Permission to use, copy, modify, and distribute this software and its
  1158. X * documentation for any purpose and without fee is hereby granted,
  1159. X * provided that the above copyright notice appear in all copies and that
  1160. X * both that copyright notice and this permission notice appear in
  1161. X * supporting documentation, and that the name of Ardent Computer
  1162. X * Corporation or Jordan Hubbard not be used in advertising or publicity
  1163. X * pertaining to distribution of the software without specific, written
  1164. X * prior permission.
  1165. X *
  1166. X */
  1167. X
  1168. X/*
  1169. X * Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
  1170. X *
  1171. X *                         All Rights Reserved
  1172. X *
  1173. X * Permission to use, copy, modify, and distribute this software and its
  1174. X * documentation for any purpose and without fee is hereby granted,
  1175. X * provided that the above copyright notice appear in all copies and that
  1176. X * both that copyright notice and this permission notice appear in
  1177. X * supporting documentation, and that the name of Digital Equipment
  1178. X * Corporation not be used in advertising or publicity pertaining to
  1179. X * distribution of the software without specific, written prior permission.
  1180. X *
  1181. X *
  1182. X * DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
  1183. X * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
  1184. X * DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
  1185. X * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
  1186. X * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
  1187. X * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
  1188. X * SOFTWARE.
  1189. X */
  1190. X
  1191. X
  1192. X/*
  1193. X * MODIFICATION HISTORY
  1194. X *
  1195. X * 000 -- M. Gancarz, DEC Ultrix Engineering Group
  1196. X * 001 -- Loretta Guarino Reid, DEC Ultrix Engineering Group,
  1197. X    Western Software Lab. Convert to X11.
  1198. X */
  1199. X
  1200. X/*
  1201. X *    StoreZap - This subroutine is used by the X Window Manager (xwm)
  1202. X *    to store the vertices for the iconify, uniconify zap.
  1203. X *
  1204. X */
  1205. X
  1206. X#include "awm.h"
  1207. X
  1208. X/*
  1209. X * Store the vertices for the zap effect.
  1210. X */
  1211. Xint StoreZap(zap, ulx_1, uly_1, lrx_1, lry_1, ulx_2, uly_2, lrx_2, lry_2)
  1212. X    register XSegment zap[];
  1213. X    int ulx_1;        /* From window, upper left X coordinate. */
  1214. X    int uly_1;        /* From window, upper left Y coordinate. */
  1215. X    int lrx_1;        /* From window, lower right X coordinate. */
  1216. X    int lry_1;        /* From window, lower right Y coordinate. */
  1217. X    int ulx_2;        /* To window, upper left X coordinate. */
  1218. X    int uly_2;        /* To window, upper left Y coordinate. */
  1219. X    int lrx_2;        /* To window, lower right X coordinate. */
  1220. X    int lry_2;        /* To window, lower right Y coordinate. */
  1221. X{
  1222. X
  1223. X    Entry("StoreZap")
  1224. X
  1225. X    /*
  1226. X     * Xor in.
  1227. X     */
  1228. X    zap[0].x1 = ulx_1;    zap[0].y1 = uly_1;
  1229. X    zap[0].x2 = ulx_2;    zap[0].y2 = uly_2;
  1230. X
  1231. X    zap[1].x1 = lrx_1;    zap[1].y1 = uly_1;
  1232. X    zap[1].x2 = lrx_2;    zap[1].y2 = uly_2;
  1233. X
  1234. X    zap[2].x1 = lrx_1;    zap[2].y1 = lry_1;
  1235. X    zap[2].x2 = lrx_2;    zap[2].y2 = lry_2;
  1236. X
  1237. X    zap[3].x1 = ulx_1;    zap[3].y1 = lry_1;
  1238. X    zap[3].x2 = ulx_2;    zap[3].y2 = lry_2;
  1239. X
  1240. X    /*
  1241. X     * Xor out.
  1242. X     */
  1243. X    zap[4].x1 = ulx_1;    zap[4].y1 = uly_1;
  1244. X    zap[4].x2 = ulx_2;    zap[4].y2 = uly_2;
  1245. X
  1246. X    zap[5].x1 = lrx_1;    zap[5].y1 = uly_1;
  1247. X    zap[5].x2 = lrx_2;    zap[5].y2 = uly_2;
  1248. X
  1249. X    zap[6].x1 = lrx_1;    zap[6].y1 = lry_1;
  1250. X    zap[6].x2 = lrx_2;    zap[6].y2 = lry_2;
  1251. X
  1252. X    zap[7].x1 = ulx_1;    zap[7].y1 = lry_1;
  1253. X    zap[7].x2 = ulx_2;    zap[7].y2 = lry_2;
  1254. X    /*
  1255. X     * Total number of vertices is 8.
  1256. X     */
  1257. X    Leave(8)
  1258. X}
  1259. END_OF_awm/StoreZap.c
  1260. if test 3762 -ne `wc -c <awm/StoreZap.c`; then
  1261.     echo shar: \"awm/StoreZap.c\" unpacked with wrong size!
  1262. fi
  1263. # end of overwriting check
  1264. fi
  1265. if test -f awm/XRdBitFD.c -a "${1}" != "-c" ; then 
  1266.   echo shar: Will not over-write existing file \"awm/XRdBitFD.c\"
  1267. else
  1268. echo shar: Extracting \"awm/XRdBitFD.c\" \(3904 characters\)
  1269. sed "s/^X//" >awm/XRdBitFD.c <<'END_OF_awm/XRdBitFD.c'
  1270. X#ident   "%W% %G%"
  1271. X
  1272. X
  1273. X
  1274. X#ifndef lint
  1275. Xstatic char *rcsid_XRdBitFD_c = "$Header: XRdBitFD.c,v 1.1 88/06/15 15:26:00 jkh Exp $";
  1276. X#endif  lint
  1277. X
  1278. X#include "X11/copyright.h"
  1279. X/*
  1280. X *
  1281. X * Copyright 1987, 1988 by Ardent Computer Corporation, Sunnyvale, Ca.
  1282. X *
  1283. X * Copyright 1987 by Jordan Hubbard.
  1284. X *
  1285. X *
  1286. X *                         All Rights Reserved
  1287. X *
  1288. X * Permission to use, copy, modify, and distribute this software and its
  1289. X * documentation for any purpose and without fee is hereby granted,
  1290. X * provided that the above copyright notice appear in all copies and that
  1291. X * both that copyright notice and this permission notice appear in
  1292. X * supporting documentation, and that the name of Ardent Computer
  1293. X * Corporation or Jordan Hubbard not be used in advertising or publicity
  1294. X * pertaining to distribution of the software without specific, written
  1295. X * prior permission.
  1296. X *
  1297. X */
  1298. X
  1299. X/* Copyright, 1988, Massachusetts Institute of Theology */
  1300. X
  1301. X#include "copyright.h"
  1302. X
  1303. X#include "Xos.h"
  1304. X#include "X11/Xlib.h"
  1305. X#include "X11/Xutil.h"
  1306. X#include "Xlibint.h"
  1307. X#include <stdio.h>
  1308. X
  1309. X#define MAX_LINE 1000
  1310. X
  1311. Xint XReadBitmapFileData(filename, width, height, data, x_hot, y_hot)
  1312. X     char *filename;
  1313. X     unsigned int *width, *height;   /* RETURNED */
  1314. X     char **data;        /* RETURNED */
  1315. X     int *x_hot, *y_hot;    /* RETURNED */
  1316. X{
  1317. X  FILE *stream;
  1318. X  char *bits = 0;
  1319. X  char *ptr;
  1320. X  char line[MAX_LINE];
  1321. X  int size, bytes;
  1322. X  char name_and_type[MAX_LINE];
  1323. X  char *type;
  1324. X  int value;
  1325. X  int version10p;
  1326. X  int padding;
  1327. X  int bytes_per_line;
  1328. X  unsigned int ww = 0;
  1329. X  unsigned int hh = 0;
  1330. X  int hx = -1;
  1331. X  int hy = -1;
  1332. X
  1333. X  if (!filename || !(stream = fopen(filename, "r")))
  1334. X    return(BitmapOpenFailed);
  1335. X
  1336. X  for (;;) {
  1337. X    if (!fgets(line, MAX_LINE, stream))
  1338. X      break;
  1339. X    if (strlen(line) == MAX_LINE-1) {
  1340. X      fclose(stream);
  1341. X      return(BitmapFileInvalid);
  1342. X    }
  1343. X
  1344. X    if (sscanf(line, "#define %s %d", name_and_type, &value) == 2) {
  1345. X      if (!(type = rindex(name_and_type, '_')))
  1346. X    type = name_and_type;
  1347. X      else
  1348. X    type++;
  1349. X      if (!strcmp("width", type))
  1350. X    ww=(unsigned int) value;
  1351. X      if (!strcmp("height", type))
  1352. X    hh=(unsigned int) value;
  1353. X      if (!strcmp("hot", type)) {
  1354. X    if (type--==name_and_type || type--==name_and_type)
  1355. X      continue;
  1356. X    if (!strcmp("x_hot", type))
  1357. X      hx = value;
  1358. X    if (!strcmp("y_hot", type))
  1359. X      hy = value;
  1360. X      }
  1361. X      continue;
  1362. X    }
  1363. X    
  1364. X    if (sscanf(line, "static short %s = {", name_and_type) == 1)
  1365. X      version10p = 1;
  1366. X    else if (sscanf(line, "static unsigned char %s = {", name_and_type) == 1)
  1367. X      version10p = 0;
  1368. X    else if (sscanf(line, "static char %s = {", name_and_type) == 1)
  1369. X      version10p = 0;
  1370. X    else continue;
  1371. X
  1372. X    if (!(type = rindex(name_and_type, '_')))
  1373. X      type = name_and_type;
  1374. X    else
  1375. X      type++;
  1376. X    if (strcmp("bits[]", type))
  1377. X      continue;
  1378. X    
  1379. X    if (!ww || !hh) {
  1380. X      fclose(stream);
  1381. X      return(BitmapFileInvalid);
  1382. X    }
  1383. X
  1384. X    padding = 0;
  1385. X    if ((ww % 16) && ((ww % 16) < 9) && version10p)
  1386. X      padding = 1;
  1387. X
  1388. X    bytes_per_line = (ww+7)/8 + padding;
  1389. X    
  1390. X    size = bytes_per_line * hh;
  1391. X    bits = (char *) Xmalloc( size );
  1392. X    if (!bits) {
  1393. X      fclose(stream);
  1394. X      return(BitmapNoMemory);
  1395. X    }
  1396. X
  1397. X    if (version10p)
  1398. X      for (bytes=0, ptr=bits; bytes<size; (bytes += 2)) {
  1399. X    if (fscanf(stream, " 0x%x%*[,}]%*[ \n]", &value) != 1) {
  1400. X      Xfree(bits);
  1401. X      fclose(stream);
  1402. X      return(BitmapFileInvalid);
  1403. X    }
  1404. X    *(ptr++) = value & 0xff;
  1405. X    if (!padding || ((bytes+2) % bytes_per_line))
  1406. X      *(ptr++) = value >> 8;
  1407. X      }
  1408. X    else
  1409. X      for (bytes=0, ptr=bits; bytes<size; bytes++, ptr++) {
  1410. X    if (fscanf(stream, " 0x%x%*[,}]%*[ \n]", &value) != 1) {
  1411. X      Xfree(bits);
  1412. X      fclose(stream);
  1413. X      return(BitmapFileInvalid);
  1414. X    }
  1415. X    *ptr=value;
  1416. X      }
  1417. X    
  1418. X  }
  1419. X
  1420. X  if (!bits) {
  1421. X    fclose(stream);
  1422. X    return(BitmapFileInvalid);
  1423. X  }
  1424. X  *data = bits;
  1425. X  *width = ww;
  1426. X  *height = hh;
  1427. X
  1428. X  if (x_hot)
  1429. X    *x_hot = hx;
  1430. X  if (y_hot)
  1431. X    *y_hot = hy;
  1432. X
  1433. X  fclose(stream);
  1434. X  return(BitmapSuccess);
  1435. X}
  1436. END_OF_awm/XRdBitFD.c
  1437. if test 3904 -ne `wc -c <awm/XRdBitFD.c`; then
  1438.     echo shar: \"awm/XRdBitFD.c\" unpacked with wrong size!
  1439. fi
  1440. # end of overwriting check
  1441. fi
  1442. if test -f awm/bitmaps/xterm.bm -a "${1}" != "-c" ; then 
  1443.   echo shar: Will not over-write existing file \"awm/bitmaps/xterm.bm\"
  1444. else
  1445. echo shar: Extracting \"awm/bitmaps/xterm.bm\" \(3798 characters\)
  1446. sed "s/^X//" >awm/bitmaps/xterm.bm <<'END_OF_awm/bitmaps/xterm.bm'
  1447. X/*****************************************************************************/
  1448. X/**       Copyright 1988 by Evans & Sutherland Computer Corporation,        **/
  1449. X/**                          Salt Lake City, Utah                           **/
  1450. X/**                                                                         **/
  1451. X/**                           All Rights Reserved                           **/
  1452. X/**                                                                         **/
  1453. X/**    Permission to use, copy, modify, and distribute this software and    **/
  1454. X/**    its documentation  for  any  purpose  and  without  fee is hereby    **/
  1455. X/**    granted, provided that the above copyright notice appear  in  all    **/
  1456. X/**    copies and that both  that  copyright  notice  and  this  permis-    **/
  1457. X/**    sion  notice appear in supporting  documentation,  and  that  the    **/
  1458. X/**    name  of Evans & Sutherland  not be used in advertising or publi-    **/
  1459. X/**    city pertaining to distribution  of the software without  specif-    **/
  1460. X/**    ic, written prior permission.                                        **/
  1461. X/**                                                                         **/
  1462. X/**    EVANS  & SUTHERLAND  DISCLAIMS  ALL  WARRANTIES  WITH  REGARD  TO    **/
  1463. X/**    THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILI-    **/
  1464. X/**    TY AND FITNESS, IN NO EVENT SHALL EVANS &  SUTHERLAND  BE  LIABLE    **/
  1465. X/**    FOR  ANY  SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY  DAM-    **/
  1466. X/**    AGES  WHATSOEVER RESULTING FROM  LOSS OF USE,  DATA  OR  PROFITS,    **/
  1467. X/**    WHETHER   IN  AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS    **/
  1468. X/**    ACTION, ARISING OUT OF OR IN  CONNECTION  WITH  THE  USE  OR PER-    **/
  1469. X/**    FORMANCE OF THIS SOFTWARE.                                           **/
  1470. X/*****************************************************************************/
  1471. X
  1472. X#define xterm_width 48
  1473. X#define xterm_height 48
  1474. Xstatic char xterm_bits[] = {
  1475. X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xff, 0xff, 0xff, 0x00,
  1476. X   0x20, 0x00, 0x00, 0x00, 0x00, 0x03, 0x20, 0xfe, 0xff, 0xff, 0x1f, 0x05,
  1477. X   0x20, 0x01, 0x00, 0x00, 0x20, 0x09, 0xa0, 0x00, 0x00, 0x00, 0x40, 0x11,
  1478. X   0xa0, 0xfc, 0xff, 0x00, 0x40, 0x21, 0xa0, 0x00, 0x00, 0x00, 0x40, 0x21,
  1479. X   0xa0, 0xfc, 0x01, 0x00, 0x40, 0x21, 0xa0, 0x00, 0x00, 0x00, 0x40, 0x21,
  1480. X   0xa0, 0xfc, 0xff, 0x3f, 0x40, 0x21, 0xa0, 0x00, 0x00, 0x00, 0x40, 0x21,
  1481. X   0xa0, 0xfc, 0x03, 0x00, 0x40, 0x21, 0xa0, 0x00, 0x00, 0x00, 0x40, 0x21,
  1482. X   0xa0, 0xfc, 0xff, 0x01, 0x40, 0x21, 0xa0, 0x00, 0x00, 0x00, 0x40, 0x21,
  1483. X   0xa0, 0xfc, 0x00, 0x00, 0x40, 0x21, 0xa0, 0x00, 0x00, 0x00, 0x40, 0x21,
  1484. X   0xa0, 0x00, 0x00, 0x00, 0x40, 0x21, 0xa0, 0x00, 0x00, 0x00, 0x40, 0x21,
  1485. X   0xa0, 0x00, 0x00, 0x00, 0x40, 0x21, 0xa0, 0x00, 0x00, 0x00, 0x40, 0x21,
  1486. X   0xa0, 0x00, 0x00, 0x00, 0x40, 0x21, 0xa0, 0x00, 0x00, 0x00, 0x40, 0x21,
  1487. X   0xa0, 0x00, 0x00, 0x00, 0x40, 0x21, 0xa0, 0x00, 0x00, 0x00, 0x40, 0x11,
  1488. X   0xa0, 0x00, 0x00, 0x00, 0x40, 0x11, 0xa0, 0x00, 0x00, 0x00, 0x40, 0x09,
  1489. X   0xa0, 0x00, 0x00, 0x00, 0x40, 0x09, 0xa0, 0x00, 0x00, 0x00, 0x40, 0x05,
  1490. X   0x20, 0x01, 0x00, 0x00, 0x20, 0x05, 0x20, 0xfe, 0xff, 0xff, 0x1f, 0x03,
  1491. X   0x20, 0x00, 0x00, 0x00, 0x00, 0x03, 0xc0, 0xff, 0xff, 0xff, 0xff, 0x00,
  1492. X   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  1493. X   0xc0, 0xff, 0xff, 0xff, 0xff, 0x03, 0x20, 0x00, 0x00, 0x00, 0x00, 0x03,
  1494. X   0xa0, 0xaa, 0xaa, 0xaa, 0x2a, 0x03, 0x10, 0x00, 0x00, 0x00, 0x80, 0x02,
  1495. X   0x50, 0x55, 0x55, 0x55, 0x95, 0x02, 0x08, 0x00, 0x00, 0x00, 0x40, 0x02,
  1496. X   0xa8, 0xaa, 0xaa, 0xaa, 0x4a, 0x02, 0x04, 0x00, 0x00, 0x00, 0x20, 0x01,
  1497. X   0xb4, 0xff, 0xff, 0xff, 0xad, 0x00, 0x02, 0x00, 0x00, 0x00, 0x50, 0x00,
  1498. X   0xfe, 0xff, 0xff, 0xff, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
  1499. END_OF_awm/bitmaps/xterm.bm
  1500. if test 3798 -ne `wc -c <awm/bitmaps/xterm.bm`; then
  1501.     echo shar: \"awm/bitmaps/xterm.bm\" unpacked with wrong size!
  1502. fi
  1503. # end of overwriting check
  1504. fi
  1505. if test -f awm/menus/dbug.h -a "${1}" != "-c" ; then 
  1506.   echo shar: Will not over-write existing file \"awm/menus/dbug.h\"
  1507. else
  1508. echo shar: Extracting \"awm/menus/dbug.h\" \(5236 characters\)
  1509. sed "s/^X//" >awm/menus/dbug.h <<'END_OF_awm/menus/dbug.h'
  1510. X#ident   "%W% %G%"
  1511. X
  1512. X/************************************************************************
  1513. X *                                    *
  1514. X *            Copyright (c) 1984, Fred Fish            *
  1515. X *                All Rights Reserved                *
  1516. X *                                    *
  1517. X *    This software and/or documentation is released into the        *
  1518. X *    public domain for personal, non-commercial use only.        *
  1519. X *    Limited rights to use, modify, and redistribute are hereby    *
  1520. X *    granted for non-commercial purposes, provided that all        *
  1521. X *    copyright notices remain intact and all changes are clearly    *
  1522. X *    documented.  The author makes no warranty of any kind with    *
  1523. X *    respect to this product and explicitly disclaims any implied    *
  1524. X *    warranties of merchantability or fitness for any particular    *
  1525. X *    purpose.                            *
  1526. X *                                    *
  1527. X ************************************************************************
  1528. X */
  1529. X
  1530. X
  1531. X/*
  1532. X *  FILE
  1533. X *
  1534. X *    dbug.h    user include file for programs using the dbug package
  1535. X *
  1536. X *  SYNOPSIS
  1537. X *
  1538. X *    #include <local/dbug.h>
  1539. X *
  1540. X *  SCCS ID
  1541. X *
  1542. X *    @(#)dbug.h    1.6 10/3/85
  1543. X *
  1544. X *  DESCRIPTION
  1545. X *
  1546. X *    Programs which use the dbug package must include this file.
  1547. X *    It contains the appropriate macros to call support routines
  1548. X *    in the dbug runtime library.
  1549. X *
  1550. X *    To disable compilation of the macro expansions define the
  1551. X *    preprocessor symbol "DBUG_OFF".  This will result in null
  1552. X *    macros expansions so that the resulting code will be smaller
  1553. X *    and faster.  (The difference may be smaller than you think
  1554. X *    so this step is recommended only when absolutely necessary).
  1555. X *    In general, tradeoffs between space and efficiency are
  1556. X *    decided in favor of efficiency since space is seldom a
  1557. X *    problem on the new machines).
  1558. X *
  1559. X *    All externally visible symbol names follow the pattern
  1560. X *    "_db_xxx..xx_" to minimize the possibility of a dbug package
  1561. X *    symbol colliding with a user defined symbol.
  1562. X *    
  1563. X *    Because the C preprocessor will not accept macros with a variable
  1564. X *    number of arguments, there are separate DBUG_<N> macros for
  1565. X *    cases N = {0,1,...NMAX}.  NMAX is currently 5.
  1566. X *
  1567. X *  AUTHOR
  1568. X *
  1569. X *    Fred Fish
  1570. X *    (Currently employed by UniSoft Systems, Berkeley, Ca.)
  1571. X *    (415) 644-1230  ext 242
  1572. X *    ucbvax!unisoft!fnf  or  dual!unisoft!fnf
  1573. X *
  1574. X */
  1575. X
  1576. X
  1577. X/*
  1578. X *    Internally used dbug variables which must be global.
  1579. X */
  1580. X
  1581. X/* This gets the debugging package already being used by uwm */
  1582. X
  1583. X#include "../support.h"
  1584. X
  1585. X#ifndef DBUG_OFF
  1586. X    extern int _db_on_;            /* TRUE if debug currently enabled */
  1587. X    extern FILE *_db_fp_;        /* Current debug output stream */
  1588. X    extern char *_db_process_;        /* Name of current process */
  1589. X    extern int _db_keyword_ ();        /* Accept/reject keyword */
  1590. X    extern void _db_push_ ();        /* Push state, set up new state */
  1591. X    extern void _db_pop_ ();        /* Pop previous debug state */
  1592. X    extern void _db_enter_ ();        /* New user function entered */
  1593. X    extern void _db_return_ ();        /* User function return */
  1594. X    extern void _db_printf_ ();        /* Print debug output */
  1595. X    extern void _db_setjmp_ ();        /* Save debugger environment */
  1596. X    extern void _db_longjmp_ ();    /* Restore debugger environment */
  1597. X# endif
  1598. X
  1599. X
  1600. X/*
  1601. X *    These macros provide a user interface into functions in the
  1602. X *    dbug runtime support library.  They isolate users from changes
  1603. X *    in the MACROS and/or runtime support.
  1604. X *
  1605. X *    The symbols "__LINE__" and "__FILE__" are expanded by the
  1606. X *    preprocessor to the current source file line number and file
  1607. X *    name respectively.
  1608. X *
  1609. X *    WARNING ---  Because the DBUG_ENTER macro allocates space on
  1610. X *    the user function's stack, it must precede any executable
  1611. X *    statements in the user function.
  1612. X *
  1613. X */
  1614. X
  1615. X# ifdef DBUG_OFF
  1616. X#    define DBUG_ENTER(a1)
  1617. X#    define DBUG_RETURN(a1) return(a1)
  1618. X#    define DBUG_VOID_RETURN return
  1619. X#    define DBUG_EXECUTE(keyword,a1)
  1620. X#    define DBUG_2(keyword,format)
  1621. X#    define DBUG_3(keyword,format,a1)
  1622. X#    define DBUG_4(keyword,format,a1,a2)
  1623. X#    define DBUG_5(keyword,format,a1,a2,a3)
  1624. X#    define DBUG_PUSH(a1)
  1625. X#    define DBUG_POP()
  1626. X#    define DBUG_PROCESS(a1)
  1627. X#    define DBUG_FILE (stderr)
  1628. X#    define DBUG_SETJMP setjmp
  1629. X#    define DBUG_LONGJMP longjmp
  1630. X# else
  1631. X#    define DBUG_ENTER(a) \
  1632. X    auto char *_db_func_, *_db_file_; \
  1633. X    int _db_level_; \
  1634. X    _db_enter_ (a,__FILE__,__LINE__,&_db_func_,&_db_file_,&_db_level_)
  1635. X#    define DBUG_LEAVE \
  1636. X    (_db_return_ (__LINE__, &_db_func_, &_db_file_, &_db_level_))
  1637. X#    define DBUG_RETURN(a1) return (DBUG_LEAVE, (a1))
  1638. X/*   define DBUG_RETURN(a1) {DBUG_LEAVE; return(a1);}  Alternate form */
  1639. X#    define DBUG_VOID_RETURN {DBUG_LEAVE; return;}
  1640. X#    define DBUG_EXECUTE(keyword,a1) \
  1641. X    if (_db_on_) {if (_db_keyword_ (keyword)) { a1; }}
  1642. X#    define DBUG_2(keyword,format) \
  1643. X    if (_db_on_) {_db_printf_ (__LINE__, keyword, format);}
  1644. X#    define DBUG_3(keyword,format,a1) \
  1645. X    if (_db_on_) {_db_printf_ (__LINE__, keyword, format, a1);}
  1646. X#    define DBUG_4(keyword,format,a1,a2) \
  1647. X    if (_db_on_) {_db_printf_ (__LINE__, keyword, format, a1, a2);}
  1648. X#    define DBUG_5(keyword,format,a1,a2,a3) \
  1649. X    if (_db_on_) {_db_printf_ (__LINE__, keyword, format, a1, a2, a3);}
  1650. X#    define DBUG_PUSH(a1) _db_push_ (a1)
  1651. X#    define DBUG_POP() _db_pop_ ()
  1652. X#    define DBUG_PROCESS(a1) (_db_process_ = a1)
  1653. X#    define DBUG_FILE (_db_fp_)
  1654. X#    define DBUG_SETJMP(a1) (_db_setjmp_ (), setjmp (a1))
  1655. X#    define DBUG_LONGJMP(a1,a2) (_db_longjmp_ (), longjmp (a1, a2))
  1656. X# endif
  1657. END_OF_awm/menus/dbug.h
  1658. if test 5236 -ne `wc -c <awm/menus/dbug.h`; then
  1659.     echo shar: \"awm/menus/dbug.h\" unpacked with wrong size!
  1660. fi
  1661. # end of overwriting check
  1662. fi
  1663. echo shar: End of archive 3 \(of 13\).
  1664. cp /dev/null ark3isdone
  1665. MISSING=""
  1666. for I in 1 2 3 4 5 6 7 8 9 10 11 12 13 ; do
  1667.     if test ! -f ark${I}isdone ; then
  1668.     MISSING="${MISSING} ${I}"
  1669.     fi
  1670. done
  1671. if test "${MISSING}" = "" ; then
  1672.     echo You have unpacked all 13 archives.
  1673.     rm -f ark[1-9]isdone ark[1-9][0-9]isdone
  1674. else
  1675.     echo You still need to unpack the following archives:
  1676.     echo "        " ${MISSING}
  1677. fi
  1678. ##  End of shell archive.
  1679. exit 0
  1680. Mike Wexler(wyse!mikew)    Phone: (408)433-1000 x1330
  1681.